package com.guoxin.chapter2.t7;

import java.util.stream.IntStream;

public class Task {
	public void doLongTask() {
		IntStream.range(0, 100).forEach(i -> System.out
				.println("nosynchronized threaName=" + Thread.currentThread().getName() + " i=" + (i + 1)));

		System.out.println("");
		synchronized (this) {
			IntStream.range(0, 100).forEach(i -> System.out
					.println("synchronized threaName=" + Thread.currentThread().getName() + " i=" + (i + 1)));
		}
	}
}
